#!/bin/bash
WORK_DIR=$(pwd)
#Only root
[[ $EUID -ne 0 ]] && echo 'Error: This script must be run as root!' && exit 1



/bin/sed -i 's/mingetty tty/mingetty --noclear tty/' /etc/inittab
/bin/sed -i 's/SELINUX=permissive/SELINUX=disabled/' /etc/selinux/config
/bin/sed -i 's/SELINUX=enforcing/SELINUX=disabled/'  /etc/selinux/config
#/bin/cat<<EOF >> /etc/profile
#export PS1='[\u@\h \W]\$ '
#EOF


systemctl disable 'postfix'
systemctl disable 'abrt-ccpp'


cat > /etc/profile.d/Je.sh <<EOF
alias ls='ls -hAF --color=auto --time-style=long-iso'
alias ll='ls -l'
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'
alias ds='ds -h'
alias df='df -h'
alias grep='egrep --color'
EOF



cat >> /etc/sysctl.conf <<-EOF
net.bridge.bridge-nf-call-ip6tables = 1 
net.bridge.bridge-nf-call-iptables = 1 
net.ipv4.ip_forward = 1
vm.swappiness = 0
EOF

mkdir /root/.ssh
pub_key='ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDlTIOziArPoGhPJ8kAfaF2frqVSLOkJEQGtjS3bXAa5gmRQexczONisruCloVQPOUpIWRjSkmBJOF32Rq3/8j9xHJzZeihJ+BwfTdZ9KQTckQS5K/AxmTeSnb3S/KTFcbR0IisbEZJFVPWSi3FTf3DFSmq2axeazhd2IsF4iU6ADl8qOVLbcFdPNuDWS98l//qFQZHMKxR+5xhEcwUFgwYFnUtcusHkBYkyeD4OKJEyamqUP8cWvIlDVveGOVWbq8Fl5tUBsR6NLhiAIlAC4ujuEaHvvaRfbkFJC/LLsAUz6vtNgOkPl8qv8Gb3Ids1Yse0P6gIIJSMLyZTceSFM1YWBO/w0g+VNdB1BDTc5tIvMTT5Ftvvkh/D44abSlkfg/5tRdnQP+3dIZTWMtLLN/WsUcWal1h6RmtJaNAzLqX/U4CnICwUt/FVXngpUwb7Bnou3Nw5/tETpd7RQgzSLEImZREh7S09L1nThJEgk9j/6WAfLCvVSwTGfiCvdwMME0= ycc@DESKTOP-BA0DP7O'
echo $pub_key >> /root/.ssh/authorized_keys
chmod 700 /root/.ssh
chmod 600 /root/.ssh/authorized_keys
chown -R root:root /root/.ssh


